/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package ged.impl;

import ged.GedPackage;
import ged.LabelPlacement;
import ged.LabelPosition;
import ged.Label_attributes;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.ecore.EClass;

import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.EObjectImpl;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Label attributes</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link ged.impl.Label_attributesImpl#getLabel_placement <em>Label placement</em>}</li>
 *   <li>{@link ged.impl.Label_attributesImpl#getLabel_position <em>Label position</em>}</li>
 *   <li>{@link ged.impl.Label_attributesImpl#isReadOnly <em>Read Only</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class Label_attributesImpl extends EObjectImpl implements Label_attributes
{
  /**
   * The default value of the '{@link #getLabel_placement() <em>Label placement</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getLabel_placement()
   * @generated
   * @ordered
   */
  protected static final LabelPlacement LABEL_PLACEMENT_EDEFAULT = LabelPlacement.INTERNAL;

  /**
   * The cached value of the '{@link #getLabel_placement() <em>Label placement</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getLabel_placement()
   * @generated
   * @ordered
   */
  protected LabelPlacement label_placement = LABEL_PLACEMENT_EDEFAULT;

  /**
   * The default value of the '{@link #getLabel_position() <em>Label position</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getLabel_position()
   * @generated
   * @ordered
   */
  protected static final LabelPosition LABEL_POSITION_EDEFAULT = LabelPosition.TOP_RIGHT;

  /**
   * The cached value of the '{@link #getLabel_position() <em>Label position</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getLabel_position()
   * @generated
   * @ordered
   */
  protected LabelPosition label_position = LABEL_POSITION_EDEFAULT;

  /**
   * The default value of the '{@link #isReadOnly() <em>Read Only</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #isReadOnly()
   * @generated
   * @ordered
   */
  protected static final boolean READ_ONLY_EDEFAULT = false;

  /**
   * The cached value of the '{@link #isReadOnly() <em>Read Only</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #isReadOnly()
   * @generated
   * @ordered
   */
  protected boolean readOnly = READ_ONLY_EDEFAULT;

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  protected Label_attributesImpl()
  {
    super();
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  protected EClass eStaticClass()
  {
    return GedPackage.Literals.LABEL_ATTRIBUTES;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public LabelPlacement getLabel_placement()
  {
    return label_placement;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setLabel_placement(LabelPlacement newLabel_placement)
  {
    LabelPlacement oldLabel_placement = label_placement;
    label_placement = newLabel_placement == null ? LABEL_PLACEMENT_EDEFAULT : newLabel_placement;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, GedPackage.LABEL_ATTRIBUTES__LABEL_PLACEMENT, oldLabel_placement, label_placement));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public LabelPosition getLabel_position()
  {
    return label_position;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setLabel_position(LabelPosition newLabel_position)
  {
    LabelPosition oldLabel_position = label_position;
    label_position = newLabel_position == null ? LABEL_POSITION_EDEFAULT : newLabel_position;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, GedPackage.LABEL_ATTRIBUTES__LABEL_POSITION, oldLabel_position, label_position));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public boolean isReadOnly()
  {
    return readOnly;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setReadOnly(boolean newReadOnly)
  {
    boolean oldReadOnly = readOnly;
    readOnly = newReadOnly;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, GedPackage.LABEL_ATTRIBUTES__READ_ONLY, oldReadOnly, readOnly));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public Object eGet(int featureID, boolean resolve, boolean coreType)
  {
    switch (featureID)
    {
      case GedPackage.LABEL_ATTRIBUTES__LABEL_PLACEMENT:
        return getLabel_placement();
      case GedPackage.LABEL_ATTRIBUTES__LABEL_POSITION:
        return getLabel_position();
      case GedPackage.LABEL_ATTRIBUTES__READ_ONLY:
        return isReadOnly();
    }
    return super.eGet(featureID, resolve, coreType);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public void eSet(int featureID, Object newValue)
  {
    switch (featureID)
    {
      case GedPackage.LABEL_ATTRIBUTES__LABEL_PLACEMENT:
        setLabel_placement((LabelPlacement)newValue);
        return;
      case GedPackage.LABEL_ATTRIBUTES__LABEL_POSITION:
        setLabel_position((LabelPosition)newValue);
        return;
      case GedPackage.LABEL_ATTRIBUTES__READ_ONLY:
        setReadOnly((Boolean)newValue);
        return;
    }
    super.eSet(featureID, newValue);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public void eUnset(int featureID)
  {
    switch (featureID)
    {
      case GedPackage.LABEL_ATTRIBUTES__LABEL_PLACEMENT:
        setLabel_placement(LABEL_PLACEMENT_EDEFAULT);
        return;
      case GedPackage.LABEL_ATTRIBUTES__LABEL_POSITION:
        setLabel_position(LABEL_POSITION_EDEFAULT);
        return;
      case GedPackage.LABEL_ATTRIBUTES__READ_ONLY:
        setReadOnly(READ_ONLY_EDEFAULT);
        return;
    }
    super.eUnset(featureID);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public boolean eIsSet(int featureID)
  {
    switch (featureID)
    {
      case GedPackage.LABEL_ATTRIBUTES__LABEL_PLACEMENT:
        return label_placement != LABEL_PLACEMENT_EDEFAULT;
      case GedPackage.LABEL_ATTRIBUTES__LABEL_POSITION:
        return label_position != LABEL_POSITION_EDEFAULT;
      case GedPackage.LABEL_ATTRIBUTES__READ_ONLY:
        return readOnly != READ_ONLY_EDEFAULT;
    }
    return super.eIsSet(featureID);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public String toString()
  {
    if (eIsProxy()) return super.toString();

    StringBuffer result = new StringBuffer(super.toString());
    result.append(" (label_placement: ");
    result.append(label_placement);
    result.append(", label_position: ");
    result.append(label_position);
    result.append(", readOnly: ");
    result.append(readOnly);
    result.append(')');
    return result.toString();
  }

} //Label_attributesImpl
